package com.nowcoder.Offer.Array;

import org.junit.Test;

import java.util.HashSet;

public class FindDuplicate {

    HashSet<Integer> set = new HashSet<>();

    public boolean duplicate(int numbers[],int length,int [] duplication) {
        for(Integer i : numbers){
            if(set.contains(i)) {
                duplication[0] = i;
                return true;
            }
            set.add(i);
        }
        return false;
    }

    @Test
    public void test(){
        int[] arr = {2,3,1,0,2,5,3};

    }
}
